<template>
  <h1>用户注册列表</h1>
  <el-row>
    <el-button type="primary" @click="getUsers">刷新</el-button>
  </el-row>

  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="name" label="姓名" width="180" />
    <el-table-column prop="sex" label="性别" width="180" />
    <el-table-column prop="addr" label="地区" />
    <el-table-column prop="hobby" label="爱好" />
  </el-table>


</template>

<script setup lang="ts">
import {ref, onMounted, onUnmounted, reactive} from 'vue'
import {getUsersReq} from "@/api/user";
let tableData = ref([])

const getUsers=()=>{
  getUsersReq().then(data=>{
    console.log(data);
    tableData.value=data
  },err=>{
    console.log(err);
  })
}
onMounted(() =>{
  getUsers()

})
</script>

<style scoped>

</style>
